home *** CD-ROM | disk | FTP | other *** search
- #include "SetUpA4.h"
- Pattern grey={ 170,85,170,85,170,85,170,85 };
-
- pascal void main(message,select,r,theCell,offset,len,LH)
- int message,offset,len;
- ListHandle LH;
- Cell theCell;
- Boolean select;
- Rect *r;
- {
- int l;
-
- RememberA0();
- SetUpA4();
- switch(message){
- case 0: break;
- case 1:
- case 2: doDraw(select,r,offset,LH); break;
- case 3: break;
- }
- RestoreA4();
- }
-
- doDraw(select,r,offset,LH)
- Boolean select;
- Rect *r;
- int offset;
- ListHandle LH;
- {
- BitMap icon;
- Rect dst;
- char *q,*s,icnoff;
- int len;
- FontInfo inf;
-
- EraseRect(r);
- dst=*r;
- dst.right=dst.left+16;
- SetRect(&icon.bounds,0,0,16,16);
- icon.rowBytes=2;
- HLock((**LH).cells);
- s=q=(char *)*(**LH).cells;
- q+=offset;
- s+=offset;
- q+=(*q+1);
- icnoff=*q<<5;
- HLock((**LH).userHandle);
- icon.baseAddr=(*(**LH).userHandle)+icnoff;
- CopyBits(&icon,&((**LH).port->portBits),&(icon.bounds),
- &dst,0,0L);
- HUnlock((**LH).userHandle);
-
- GetFontInfo(&inf);
- len=inf.ascent+inf.descent+inf.leading;
- MoveTo(dst.right+2,(r->bottom+r->top+len)/2-inf.descent);
- DrawString(s);
- HUnlock((**LH).cells);
- if(select){
- HiliteMode&=127;
- InvertRect(r);
- }
- }
-
-